From: Matthieu Gallien Date: Tue, 26 Nov 2024 17:12:36 +0000 (+0100) Subject: when updating a virtual file after lock/unlock: avoid setting modtime X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~30^2^2~219^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=42cae2c5f1c02c63d3ff42c665c734dc6d0bedc1;p=nextcloud-desktop.git when updating a virtual file after lock/unlock: avoid setting modtime will prevent truncating the modification time when changing the lock state of a file could be visible when using an office software to open an office file with automated locking happening after the file gets opened Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index e35be0168..a2547dafa 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -666,7 +666,7 @@ void Folder::slotFilesLockReleased(const QSet &files) SyncJournalFileRecord rec; const auto isFileRecordValid = journalDb()->getFileRecord(fileRecordPath, &rec) && rec.isValid(); if (isFileRecordValid) { - [[maybe_unused]] const auto result = _vfs->updateMetadata(path() + rec.path(), rec._modtime, rec._fileSize, rec._fileId); + [[maybe_unused]] const auto result = _vfs->updatePlaceholderMarkInSync(path() + rec.path(), rec._fileId); } const auto canUnlockFile = isFileRecordValid && rec._lockstate._locked @@ -709,7 +709,7 @@ void Folder::slotFilesLockImposed(const QSet &files) const auto fileRecordPath = fileFromLocalPath(file); SyncJournalFileRecord rec; if (journalDb()->getFileRecord(fileRecordPath, &rec) && rec.isValid()) { - [[maybe_unused]] const auto result = _vfs->updateMetadata(path() + rec.path(), rec._modtime, rec._fileSize, rec._fileId); + [[maybe_unused]] const auto result = _vfs->updatePlaceholderMarkInSync(path() + rec.path(), rec._fileId); } } }